﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;

namespace VoteSystem.Model.Models
{
    public class DbContextFactory
    {
        public static VoteSystemContext GetDbContext()
        {
            VoteSystemContext context = CallContext.GetData("DbContext") as VoteSystemContext;
            if (context == null)
            {
                context = new VoteSystemContext();
                CallContext.SetData("DbContext", context);
            }
            return context;
        }
    }
}
